<template>
  <ul>
      <li class="liMenu" 
        :class="idx==index?'hover':''" @click="son(item,idx)" v-for="(item,idx) in menu"                 
        :key="idx">{{item}}
      </li>
</ul>
</template>

<script>
export default {
    
data(){
        return{
            menu:['首页','列表页','详情页'],
            index:0
        }
    },
    methods:{
      son(item,idx){
          this.index=idx;
      }
    }

}
</script>

<style>

.liMenu{
  margin-right: 20px;
  cursor:pointer;
}
.liMenu.hover{
  color:red;
}

</style>